package com.xydtech.workflow.mapper;

import com.xydtech.workflow.domain.WflFlowstep;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 流程节点配置Mapper接口
 *
 * @author JHON
 * @date 2021-05-07
 */
public interface WflFlowstepMapper {

    /**
     * 查询流程节点配置列表
     *
     * @param wflFlowstep 流程节点配置
     * @return 流程节点配置集合
     */
    public List<WflFlowstep> selectWflFlowstepList(WflFlowstep wflFlowstep);

    /**
     * 查询流程节点配置
     *
     * @param versionId 流程节点配置ID
     * @return 流程节点配置
     */
    public List<WflFlowstep> selectWflFlowstepById(Long versionId);

    /**
     *根据版本号和顺序号查询流程节点信息
     * @Title: selectWflFlowstepByVersionIdAndOrderNum
     * @param versionId
     * @param orderNum
     * @return com.xydtech.workflow.domain.WflFlowstep
     * @exception
     * @author JHON
     * @Date 2021/5/28 18:03
     **/
    public WflFlowstep selectWflFlowstepByVersionIdAndOrderNum(@Param("versionId") Long versionId, @Param("orderNum") Long orderNum);

    /**
     *查询小于当前步骤序号的流程节点信息
     * @Title: selectApprBackStep
     * @param wflFlowstep
     * @return java.util.List<com.xydtech.workflow.domain.WflFlowstep>
     * @exception
     * @author JHON
     * @Date 2021/5/27 15:52
     **/
    public List<WflFlowstep> selectApprBackStep(WflFlowstep wflFlowstep);

    /**
     * 新增流程节点配置
     *
     * @param list 流程节点配置
     * @return 结果
     */
    public int insertWflFlowstep(List<WflFlowstep> list);

    /**
     * 复制流程节点配置
     *
     * @param wflFlowstep 流程节点配置
     * @return 结果
     */
    public int copyWflFlowstep(WflFlowstep wflFlowstep);

    /**
     * 修改流程节点配置
     *
     * @param wflFlowstep 流程节点配置
     * @return 结果
     */
    public int updateWflFlowstep(WflFlowstep wflFlowstep);

    /**
     *向上移动流程节点时修改被替换位置节点顺序号
     * @Title: updateWflFlowstepByVersionIdAndOrderNum
     * @param wflFlowstep
     * @return int
     * @exception
     * @author JHON
     * @Date 2021/5/26 16:39
     **/
    public int updateUpstepOrderNumByVersionIdAndOrderNum(WflFlowstep wflFlowstep);

    /**
     *向下移动流程节点时修改被替换位置节点顺序号
     * @Title: updateDownstepOrderNumByVersionIdAndOrderNum
     * @param wflFlowstep
     * @return int
     * @exception
     * @author JHON
     * @Date 2021/5/26 16:39
     **/
    public int updateDownstepOrderNumByVersionIdAndOrderNum(WflFlowstep wflFlowstep);

    /**
     *批量修改流程步骤信息
     * @Title: bathUpdateWflFlowstep
     * @param list
     * @return int
     * @exception
     * @author JHON
     * @Date 2021/5/26 14:17
     **/
    public int bathUpdateWflFlowstep(List<WflFlowstep> list);

    /**
     *新增流程节点原有结束节点更新为中间节点
     * @Title: updateWflFlowstepType
     * @param versionId
     * @return int
     * @exception
     * @author JHON
     * @Date 2021/5/26 13:59
     **/
    public int updateWflFlowstepType(Long versionId);

    /**
     *批量删除流程节点配置
     * @Title: deleteWflFlowstepByVersionIdAndStepIds
     * @param versionId
     * @param list
     * @return int
     * @exception
     * @author JHON
     * @Date 2021/5/26 13:08
     **/
    public int deleteWflFlowstepByVersionIdAndStepIds(@Param("versionId") Long versionId, @Param("list") List<WflFlowstep> list);

    /**
     *根据版本号和顺序号查询后边所有流程节点
     * @Title: selectWflFlowstepByVersionIdAndOrderNum
     * @param versionId
     * @param orderNum
     * @return com.xydtech.workflow.domain.WflFlowstep
     * @exception
     * @author JHON
     * @Date 2021/5/28 18:03
     **/
    public List<WflFlowstep> selectFollowUpStepByVersionIdAndOrderNum(@Param("versionId") Long versionId, @Param("orderNum") Long orderNum);

}
